var express = require('express');
var router = express.Router();

const dataCtrl=require('../controllers/news.controller');
const cateCtrl=require('../controllers/newscate.controller');

router.get('/', function(req, res, next) {
    res.send('news');
});
router.post('/data', dataCtrl.create);
router.get('/data/:id', dataCtrl.getData);
router.put('/data/:id', dataCtrl.update);
router.delete('/data/:id', dataCtrl.remove);
router.post('/data/:id', dataCtrl.removes);
router.post('/list', dataCtrl.list);
router.post('/cate/:type', cateCtrl.getcate);
router.post('/cate', cateCtrl.addcate);

module.exports = router;